{include file="pub_header.htm"}
<div class="out_table">
<table width="100%" cellpadding="6" cellspacing="6" border="0" align="center" class="frame_table">
  <tr>
    <td width="20%" align="center" valign="top" bgcolor="#EEEEEE">
      {include file="pub_submenu.htm"}
    </td>
    <td width="80%" align="center" valign="top" bgcolor="#FFFFFF">

      {if $get.ope == "add"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=friendlink" target="_self" class="current_place">友情链接管理</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=friendlink&ope=add&pag={$get.pag}" target="_self" class="current_place">添加友情链接</a>
            <a href="{$control_admin}?act=friendlink&pag={$get.pag}" target="_self" class="current_place">返回列表</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="friendlink_add" name="friendlink_add" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="2">添加友情链接</td>
        </tr>
        <tr align="left">
          <td width="10%" class="block_left" nowrap>
          <table border="0" cellspacing="0" cellpadding="3" align="right">
            <tr>
              <td rowspan="2" nowrap>标题</td>
              <td nowrap bgcolor="#CCCCCC">简短</td>
            </tr>
            <tr>
              <td nowrap bgcolor="#CCCCCC">完整</td>
            </tr>
          </table>
          </td>
          <td width="90%" class="block_right" nowrap>
          <table width="100%" border="0" cellspacing="0" cellpadding="1">
            <tr>
              <td nowrap>
              <select id="prefix" name="prefix" class="select" style="width:60px;">
                <option value="">前缀</option>
                {foreach name=friendlink_prefix from=$select_option.friendlink_prefix item=friendlink_prefix}
                  {if $friendlink_prefix.if_default == "1"}
                  <option value="{$friendlink_prefix.id}" selected="selected">{$friendlink_prefix.value}</option>
                  {else}
                  <option value="{$friendlink_prefix.id}">{$friendlink_prefix.value}</option>
                  {/if}
                {/foreach}
              </select>
              <input type="text" id="phrase" name="phrase" maxlength="255" size="68" value=""
                style="font-family: 'Tahoma', 'Arial', 'Helvetica', 'sans-serif';
                       font-size: 12px;
                       color: #000000;
                       width: 360px;
                       height: 18px;
                       border: 1px solid #B9CFF0;
                       background-color: #FFFFFF;
                       background: url('{$dir_images_admin}/phrase_bg.gif');
                       background-repeat: repeat-x;
                       background-position: left center;">
              <select id="color" name="color" class="select" style="width:60px;">
                <option value="">颜色</option>
                {foreach name=friendlink_color from=$select_option.friendlink_color item=friendlink_color}
                  {if $friendlink_color.if_default == "1"}
                  <option value="{$friendlink_color.id}" style="background-color:{$friendlink_color.value}" selected="selected">{$friendlink_color.name}</option>
                  {else}
                  <option value="{$friendlink_color.id}" style="background-color:{$friendlink_color.value}">{$friendlink_color.name}</option>
                  {/if}
                {/foreach}
              </select>
              <select id="fontstyle" name="fontstyle" class="select" style="width:60px;">
                <option value="">风格</option>
                {foreach name=friendlink_fontstyle from=$select_option.friendlink_fontstyle item=friendlink_fontstyle}
                  {if $friendlink_fontstyle.if_default == "1"}
                  <option value="{$friendlink_fontstyle.id}" style="{$friendlink_fontstyle.value}" selected="selected">{$friendlink_fontstyle.name}</option>
                  {else}
                  <option value="{$friendlink_fontstyle.id}" style="{$friendlink_fontstyle.value}">{$friendlink_fontstyle.name}</option>
                  {/if}
                {/foreach}
              </select>
              <select id="decoration" name="decoration" class="select" style="width:60px;">
                <option value="">修饰</option>
                {foreach name=friendlink_decoration from=$select_option.friendlink_decoration item=friendlink_decoration}
                  {if $friendlink_decoration.if_default == "1"}
                  <option value="{$friendlink_decoration.id}" style="{$friendlink_decoration.value}" selected="selected">{$friendlink_decoration.name}</option>
                  {else}
                  <option value="{$friendlink_decoration.id}" style="{$friendlink_decoration.value}">{$friendlink_decoration.name}</option>
                  {/if}
                {/foreach}
              </select>
              <span id="phrase_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
            <tr>
              <td nowrap>
                <input type="text" id="subject" name="subject" maxlength="255" size="120" style="width:620px;" value="" class="input">
                <span id="subject_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">关键字</td>
          <td class="block_right"><input type="text" id="keyword" name="keyword" maxlength="255" size="120" style="width:620px;" value="" class="input"><span id="keyword_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">浏览次数</td>
          <td class="block_right"><input type="text" id="click" name="click" maxlength="11" size="120" style="width:620px;" value="0" class="input"><span id="click_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">简介</td>
          <td class="block_right"><textarea id="brief" name="brief" rows="3" cols="120" style="width:620px;" class="textarea"></textarea><span id="brief_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">排序</td>
          <td class="block_right"><input type="text" id="rank" name="rank" maxlength="11" size="20" style="width:120px;" value="" class="input"><span id="rank_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">是否开启</td>
          <td class="block_right">
            <select id="if_enable" name="if_enable" size="1" class="select" onchange="xajax_friendlink_if_enable('if_enable_time', this.value);">
              <option value="1" selected="selected">是</option>
              <option value="2">否</option>
              <option value="3">定时</option>
            </select>
            <span id="if_enable_time" style="display:none">
              开始:<input type="text" id="if_enable_begin" name="if_enable_begin" size="10" style="width:70px;" maxlength="10" value="" class="input" />
              结束:<input type="text" id="if_enable_end" name="if_enable_end" size="10" style="width:70px;" maxlength="10" value="" class="input" />
            </span>
            <span id="if_enable_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">是否置顶</td>
          <td class="block_right">
            <select id="if_top" name="if_top" size="1" class="select" onchange="xajax_friendlink_if_top('if_top_time', this.value);">
              <option value="1">是</option>
              <option value="2" selected="selected">否</option>
              <option value="3">定时</option>
            </select>
            <span id="if_top_time" style="display:none">
              开始:<input type="text" id="if_top_begin" name="if_top_begin" size="10" style="width:70px;" maxlength="10" value="" class="input" />
              结束:<input type="text" id="if_top_end" name="if_top_end" size="10" style="width:70px;" maxlength="10" value="" class="input" />
            </span>
            <span id="if_top_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">封面图片</td>
          <td class="block_right">
          <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FDF4E3">
            <tr>
              <td colspan="4" align="left">
                允许的文件类型:[{$setting_cover.type|implode_str:"|"}]  
              </td>
            </tr>
            <tr>
              <td width="5%" rowspan="2" align="center"><span id="cover_str" name="cover_str">{$cover_str}</span></td>
              <td width="25%" align="left">
                <span id="cover_upload_input" name="cover_upload_input">
                  <input type="file" id="cover_upload" name="cover_upload" size="30" style="width:250px;" class="input" />
                </span>             
              </td>
              <td width="10%" align="left">
                <input type="button" id="cover_upload_submit" name="cover_upload_submit" value="本地上传" class="button" onClick="xajax.$('cover_upload_submit').disabled=true;xajax_upload_submit('friendlink_add','{$control_admin}?act=friendlink&ope=savecover_upload&type=add&friendlink_id={$admin.mid}','cover_upload_prompt');">
              </td>
              <td width="60%" align="left">
                <span id="cover_upload_prompt" name="cover_upload_prompt"></span>   
              </td>
            </tr>
            <tr>
              <td width="25%" align="left">
                <span id="cover_get_input" name="cover_get_input">
                  <input type="text" id="cover_get" name="cover_get" size="45" style="width:250px;" class="input" />
                </span>    
              </td>
              <td width="10%" align="left">
                <input type="button" id="cover_get_submit" name="cover_get_submit" value="地址获取" class="button" onClick="xajax.$('cover_get_submit').disabled=true;xajax_cover_get('add','{$admin.mid}','cover_get',cover_get.value,'cover_get_submit','cover_str','cover_get_prompt');">  
              </td>
              <td width="60%" align="left">
                <span id="cover_get_prompt" name="cover_get_prompt"></span>     
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">跳转网址</td>
          <td class="block_right">
            <input type="checkbox" id="if_turn" name="if_turn" value="1" onclick="xajax_friendlink_if_turn('if_turn_detail', this.checked, 'form_detail');">
            <span id="if_turn_detail" style="display:none;">
              <select id="if_turn_type" name="if_turn_type" class="select" style="width:70px;">
                <option value="1" selected="selected">_blank</option>
                <option value="2">_self</option>
              </select>
              <input type="text" id="if_turn_url" name="if_turn_url" size="100" style="width:520px;" maxlength="255" value="" class="input" />
            </span>
            <span id="if_turn_detail_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr>
          <td colspan="2">
          <!-- detail begin -->
          <div id="form_detail">
          <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
            <tr align="left">
              <td width="10%" class="block_left">详细</td>
              <td width="90%" class="block_right"><textarea rows="18" cols="120" style="width:620px;" id="detail" name="detail" class="textarea"></textarea><span id="detail_return" class="prompt"><span class="prompt_primal"></span></span></td>
            </tr>
            <tr align="left">
              <td class="block_left">分页</td>
              <td class="block_right">
                <select id="detail_page_type" name="detail_page_type" size="1" class="select" onchange="xajax_page_type('detail_page_word_detail', this.value, 'detail_page_word');">
                  <option value="1" selected="selected">手动分页</option>
                  <option value="2">自动分页</option>
                </select>
                <span id="detail_page_word_detail"></span>
                <span id="detail_page_word_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
            <tr align="left">
              <td class="block_left" valign="top"><br /><br /><br />附件上传</td>
              <td class="block_right">
              {literal}
              <script type="text/javascript">
              <!--
                function attach_get(serial) { 
                    $('#'+serial).select(); 
                    return $('#'+serial).val();
                }
                function attach_ret(serial) {
                    alert('复制成功...'); 
                    return;
                }
              //-->
              </script>
              {/literal}
              <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FDF4E3">
                <tr>
                  <td colspan="6" align="left">
                    允许的文件类型:[{$setting_attach.type|implode_str:"|"}]
                  </td>
                </tr>
                <tr>
                  <td width="5%" rowspan="2" align="center"><b>描<br />述</b></td>
                  <td width="25%" rowspan="2" align="left"><textarea id="attach_brief" name="attach_brief" rows="2" cols="24" class="textarea"></textarea></td>
                  <td width="5%" rowspan="2" align="center"><span id="attach_select" name="attach_select">{$attach_select_result}</span></td>
                  <td width="25%" align="left">
                    <span id="attach_upload_input" name="attach_upload_input">
                      <input type="file" id="attach_upload" name="attach_upload" size="12" style="width:140px;" class="input" onchange="xajax_attach_showselect('attach_select','attach_upload_prompt',this.value);" />
                    </span>
                  </td>
                  <td width="10%" align="left">
                    <input type="button" id="attach_upload_submit" name="attach_upload_submit" value="本地上传" class="button" onclick="xajax.$('attach_upload_submit').disabled=true;xajax_upload_submit('friendlink_add','{$control_admin}?act=friendlink&ope=saveattach_upload&type=add&friendlink_id={$admin.mid}','attach_upload_prompt');">
                  </td>
                  <td width="30%" align="left">
                    <span id="attach_upload_prompt" name="attach_upload_prompt"></span>
                  </td>
                </tr>
                <tr>
                  <td width="25%" align="left">
                    <span id="attach_get_input" name="attach_get_input">
                      <input type="text" id="attach_get" name="attach_get" size="24" style="width:140px;" class="input" onchange="xajax_attach_showselect('attach_select','attach_get_prompt',this.value);" />
                    </span>
                  </td>
                  <td width="10%" align="left">
                    <input type="button" id="attach_get_submit" name="attach_get_submit" value="地址获取" class="button" onclick="xajax.$('attach_get_submit').disabled=true;xajax_attach_get('add','{$admin.mid}','attach_get',attach_get.value,'attach_get_submit','attach_list','attach_brief',attach_brief.value,'attach_select','attach_get_prompt');">
                  </td>
                  <td width="30%" align="left">
                    <span id="attach_get_prompt" name="attach_get_prompt"></span>
                  </td>
                </tr>
                <tr>
                  <td colspan="6" align="left">
                    <span id="attach_list" name="attach_list">{$attach_list_result}</span>
                  </td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
          </div>
          <!-- detail end -->
          </td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="block_footer">
          <input type="button" id="friendlink_submit" name="friendlink_submit" value="添加" class="button"
            onclick="xajax.$('friendlink_submit').disabled=true;
                     xajax.$('friendlink_submit').value='请等待...';
                     xajax.$('detail').value = CKEDITOR.instances.detail.getData();
                     xajax_submit_form('add',xajax.getFormValues('friendlink_add'),'friendlink_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {elseif $get.ope == "amend"}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=friendlink" target="_self" class="current_place">友情链接管理</a>
          </td>
          <td align="right" nowrap>
            [
            <a href="{$control_admin}?act=friendlink&ope=add&pag={$get.pag}" target="_self" class="current_place">添加友情链接</a>
            <a href="{$control_admin}?act=friendlink&pag={$get.pag}" target="_self" class="current_place">返回列表</a>
            ]
          </td>
        </tr>
      </table>
      </div>

      <div class="space"></div>
      <div class="right_table">
      <form id="friendlink_amend" name="friendlink_amend" method="post" action="javascript:void(null);" enctype="multipart/form-data">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="2">编辑友情链接</td>
        </tr>
        <tr align="left">
          <td width="10%" class="block_left" nowrap>ID</td>
          <td width="90%" class="block_right" nowrap>{$friendlink_info.id}</td>
        </tr>
        <tr align="left">
          <td class="block_left" nowrap>
          <table border="0" cellspacing="0" cellpadding="3" align="right">
            <tr>
              <td rowspan="2" nowrap>标题</td>
              <td nowrap bgcolor="#CCCCCC">简短</td>
            </tr>
            <tr>
              <td nowrap bgcolor="#CCCCCC">完整</td>
            </tr>
          </table>
          </td>
          <td class="block_right" nowrap>
          <table width="100%" border="0" cellspacing="0" cellpadding="1">
            <tr>
              <td nowrap>
              <select id="prefix" name="prefix" class="select" style="width:60px;">
                <option value="">前缀</option>
                {foreach name=friendlink_prefix from=$select_option.friendlink_prefix item=friendlink_prefix}
                  {if $friendlink_prefix.id == $friendlink_info.prefix}
                  <option value="{$friendlink_prefix.id}" selected="selected">{$friendlink_prefix.value}</option>
                  {else}
                  <option value="{$friendlink_prefix.id}">{$friendlink_prefix.value}</option>
                  {/if}
                {/foreach}
              </select>
              <input type="text" id="phrase" name="phrase" maxlength="255" size="68" value="{$friendlink_info.phrase}"
                style="font-family: 'Tahoma', 'Arial', 'Helvetica', 'sans-serif';
                       font-size: 12px;
                       color: #000000;
                       width: 360px;
                       height: 18px;
                       border: 1px solid #B9CFF0;
                       background-color: #FFFFFF;
                       background: url('{$dir_images_admin}/phrase_bg.gif');
                       background-repeat: repeat-x;
                       background-position: left center;">
              <select id="color" name="color" class="select" style="width:60px;">
                <option value="">颜色</option>
                {foreach name=friendlink_color from=$select_option.friendlink_color item=friendlink_color}
                  {if $friendlink_color.id == $friendlink_info.color}
                  <option value="{$friendlink_color.id}" style="background-color:{$friendlink_color.value}" selected="selected">{$friendlink_color.name}</option>
                  {else}
                  <option value="{$friendlink_color.id}" style="background-color:{$friendlink_color.value}">{$friendlink_color.name}</option>
                  {/if}
                {/foreach}
              </select>
              <select id="fontstyle" name="fontstyle" class="select" style="width:60px;">
                <option value="">风格</option>
                {foreach name=friendlink_fontstyle from=$select_option.friendlink_fontstyle item=friendlink_fontstyle}
                  {if $friendlink_fontstyle.id == $friendlink_info.fontstyle}
                  <option value="{$friendlink_fontstyle.id}" style="{$friendlink_fontstyle.value}" selected="selected">{$friendlink_fontstyle.name}</option>
                  {else}
                  <option value="{$friendlink_fontstyle.id}" style="{$friendlink_fontstyle.value}">{$friendlink_fontstyle.name}</option>
                  {/if}
                {/foreach}
              </select>
              <select id="decoration" name="decoration" class="select" style="width:60px;">
                <option value="">修饰</option>
                {foreach name=friendlink_decoration from=$select_option.friendlink_decoration item=friendlink_decoration}
                  {if $friendlink_decoration.id == $friendlink_info.decoration}
                  <option value="{$friendlink_decoration.id}" style="{$friendlink_decoration.value}" selected="selected">{$friendlink_decoration.name}</option>
                  {else}
                  <option value="{$friendlink_decoration.id}" style="{$friendlink_decoration.value}">{$friendlink_decoration.name}</option>
                  {/if}
                {/foreach}
              </select>
              <span id="phrase_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
            <tr>
              <td nowrap>
                <input type="text" id="subject" name="subject" maxlength="255" size="120" style="width:620px;" value="{$friendlink_info.subject|str_entag:'space,br'}" class="input">
                <span id="subject_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">关键字</td>
          <td class="block_right"><input type="text" id="keyword" name="keyword" maxlength="255" size="120" style="width:620px;" value="{$friendlink_info.keyword}" class="input"><span id="keyword_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">浏览次数</td>
          <td class="block_right"><input type="text" id="click" name="click" maxlength="11" size="120" style="width:620px;" value="{$friendlink_info.click}" class="input"><span id="click_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">简介</td>
          <td class="block_right"><textarea id="brief" name="brief" rows="3" cols="120" style="width:620px;" class="textarea">{$friendlink_info.brief|str_entag}</textarea><span id="brief_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">排序</td>
          <td class="block_right"><input type="text" id="rank" name="rank" maxlength="11" size="20" style="width:120px;" value="{$friendlink_info.rank}" class="input"><span id="rank_return" class="prompt"><span class="prompt_primal"></span></span></td>
        </tr>
        <tr align="left">
          <td class="block_left">是否开启</td>
          <td class="block_right">
            <select id="if_enable" name="if_enable" size="1" class="select" onchange="xajax_friendlink_if_enable('if_enable_time', this.value);">
              <option value="1" {if $friendlink_info.if_enable != "2" && $friendlink_info.if_enable != "3" }selected="selected"{/if}>是</option>
              <option value="2" {if $friendlink_info.if_enable == "2"}selected="selected"{/if}>否</option>
              <option value="3" {if $friendlink_info.if_enable == "3"}selected="selected"{/if}>定时</option>
            </select>
            <span id="if_enable_time" style="display:none">
              开始:<input type="text" id="if_enable_begin" name="if_enable_begin" size="10" style="width:70px;" maxlength="10" value="{$friendlink_info.if_enable_begin|date_format:'%Y-%m-%d'}" class="input" />
              结束:<input type="text" id="if_enable_end" name="if_enable_end" size="10" style="width:70px;" maxlength="10" value="{$friendlink_info.if_enable_end|date_format:'%Y-%m-%d'}" class="input" />
            </span>
            <span id="if_enable_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">是否置顶</td>
          <td class="block_right">
            <select id="if_top" name="if_top" size="1" class="select" onchange="xajax_friendlink_if_top('if_top_time', this.value);">
              <option value="1" {if $friendlink_info.if_top == "1"}selected="selected"{/if}>是</option>
              <option value="2" {if $friendlink_info.if_top != "1" && $friendlink_info.if_top != "3"}selected="selected"{/if}>否</option>
              <option value="3" {if $friendlink_info.if_top == "3"}selected="selected"{/if}>定时</option>
            </select>
            <span id="if_top_time" style="display:none">
              开始:<input type="text" id="if_top_begin" name="if_top_begin" size="10" style="width:70px;" maxlength="10" value="{$friendlink_info.if_top_begin|date_format:'%Y-%m-%d'}" class="input" />
              结束:<input type="text" id="if_top_end" name="if_top_end" size="10" style="width:70px;" maxlength="10" value="{$friendlink_info.if_top_end|date_format:'%Y-%m-%d'}" class="input" />
            </span>
            <span id="if_top_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">封面图片</td>
          <td class="block_right">
          <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FDF4E3">
            <tr>
              <td colspan="4" align="left">
                允许的文件类型:[{$setting_cover.type|implode_str:"|"}]  
              </td>
            </tr>
            <tr>
              <td width="5%" rowspan="2" align="center"><span id="cover_str" name="cover_str">{$cover_str}</span></td>
              <td width="25%" align="left">
                <span id="cover_upload_input" name="cover_upload_input">
                  <input type="file" id="cover_upload" name="cover_upload" size="30" style="width:250px;" class="input" />
                </span>             
              </td>
              <td width="10%" align="left">
                <input type="button" id="cover_upload_submit" name="cover_upload_submit" value="本地上传" class="button" onClick="xajax.$('cover_upload_submit').disabled=true;xajax_upload_submit('friendlink_amend','{$control_admin}?act=friendlink&ope=savecover_upload&type=amend&friendlink_id={$friendlink_info.id}','cover_upload_prompt');">
              </td>
              <td width="60%" align="left">
                <span id="cover_upload_prompt" name="cover_upload_prompt"></span>   
              </td>
            </tr>
            <tr>
              <td width="25%" align="left">
                <span id="cover_get_input" name="cover_get_input">
                  <input type="text" id="cover_get" name="cover_get" size="45" style="width:250px;" class="input" />
                </span>    
              </td>
              <td width="10%" align="left">
                <input type="button" id="cover_get_submit" name="cover_get_submit" value="地址获取" class="button" onClick="xajax.$('cover_get_submit').disabled=true;xajax_cover_get('amend','{$friendlink_info.id}','cover_get',cover_get.value,'cover_get_submit','cover_str','cover_get_prompt');">  
              </td>
              <td width="60%" align="left">
                <span id="cover_get_prompt" name="cover_get_prompt"></span>     
              </td>
            </tr>
          </table>
          </td>
        </tr>
        <tr align="left">
          <td class="block_left">跳转网址</td>
          <td class="block_right">
            <input type="checkbox" id="if_turn" name="if_turn" value="1" {if $friendlink_info.if_turn == "1"}checked="checked"{/if} onclick="xajax_friendlink_if_turn('if_turn_detail', this.checked, 'form_detail');">
            <span id="if_turn_detail" style="display:none;">
              <select id="if_turn_type" name="if_turn_type" class="select" style="width:70px;">
                <option value="1" {if $friendlink_info.if_turn_type != "2"}selected="selected"{/if}>_blank</option>
                <option value="2" {if $friendlink_info.if_turn_type == "2"}selected="selected"{/if}>_self</option>
              </select>
              <input type="text" id="if_turn_url" name="if_turn_url" size="100" style="width:520px;" maxlength="255" value="{$friendlink_info.if_turn_url}" class="input" />
            </span>
            <span id="if_turn_detail_return" class="prompt"><span class="prompt_primal"></span></span>
          </td>
        </tr>
        <tr>
          <td colspan="2">
          <!-- detail begin -->
          <div id="form_detail">
          <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
            <tr align="left">
              <td width="10%" class="block_left">详细</td>
              <td width="90%" class="block_right"><textarea rows="18" cols="120" style="width:620px;" id="detail" name="detail" class="textarea">{$friendlink_info.detail}</textarea><span id="detail_return" class="prompt"><span class="prompt_primal"></span></span></td>
            </tr>
            <tr align="left">
              <td class="block_left">分页</td>
              <td class="block_right">
                <select id="detail_page_type" name="detail_page_type" size="1" class="select" onchange="xajax_page_type('detail_page_word_detail', this.value, 'detail_page_word');">
                  <option value="1" selected="selected">手动分页</option>
                  <option value="2">自动分页</option>
                </select>
                <span id="detail_page_word_detail"></span>
                <span id="detail_page_word_return" class="prompt"><span class="prompt_primal"></span></span>
              </td>
            </tr>
            <tr align="left">
              <td class="block_left" valign="top"><br /><br /><br />附件上传</td>
              <td class="block_right">
              {literal}
              <script type="text/javascript">
              <!--
                function attach_get(serial) { 
                    $('#'+serial).select(); 
                    return $('#'+serial).val();
                }
                function attach_ret(serial) {
                    alert('复制成功...'); 
                    return;
                }
              //-->
              </script>
              {/literal}
              <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FDF4E3">
                <tr>
                  <td colspan="6" align="left">
                    允许的文件类型:[{$setting_attach.type|implode_str:"|"}]
                  </td>
                </tr>
                <tr>
                  <td width="5%" rowspan="2" align="center"><b>描<br />述</b></td>
                  <td width="25%" rowspan="2" align="left"><textarea id="attach_brief" name="attach_brief" rows="2" cols="24" class="textarea"></textarea></td>
                  <td width="5%" rowspan="2" align="center"><span id="attach_select" name="attach_select">{$attach_select_result}</span></td>
                  <td width="25%" align="left">
                    <span id="attach_upload_input" name="attach_upload_input">
                      <input type="file" id="attach_upload" name="attach_upload" size="12" style="width:140px;" class="input" onchange="xajax_attach_showselect('attach_select','attach_upload_prompt',this.value);" />
                    </span>
                  </td>
                  <td width="10%" align="left">
                    <input type="button" id="attach_upload_submit" name="attach_upload_submit" value="本地上传" class="button" onclick="xajax.$('attach_upload_submit').disabled=true;xajax_upload_submit('friendlink_amend','{$control_admin}?act=friendlink&ope=saveattach_upload&type=amend&friendlink_id={$friendlink_info.id}','attach_upload_prompt');">
                  </td>
                  <td width="30%" align="left">
                    <span id="attach_upload_prompt" name="attach_upload_prompt"></span>
                  </td>
                </tr>
                <tr>
                  <td width="25%" align="left">
                    <span id="attach_get_input" name="attach_get_input">
                      <input type="text" id="attach_get" name="attach_get" size="24" style="width:140px;" class="input" onchange="xajax_attach_showselect('attach_select','attach_get_prompt',this.value);" />
                    </span>
                  </td>
                  <td width="10%" align="left">
                    <input type="button" id="attach_get_submit" name="attach_get_submit" value="地址获取" class="button" onclick="xajax.$('attach_get_submit').disabled=true;xajax_attach_get('amend','{$friendlink_info.id}','attach_get',attach_get.value,'attach_get_submit','attach_list','attach_brief',attach_brief.value,'attach_select','attach_get_prompt');">
                  </td>
                  <td width="30%" align="left">
                    <span id="attach_get_prompt" name="attach_get_prompt"></span>
                  </td>
                </tr>
                <tr>
                  <td colspan="6" align="left">
                    <span id="attach_list" name="attach_list">{$attach_list_result}</span>
                  </td>
                </tr>
              </table>
              </td>
            </tr>
          </table>
          </div>
          <!-- detail end -->
          </td>
        </tr>
        <tr>
          <td colspan="2" align="center" class="block_footer">
          <input type="button" id="friendlink_submit" name="friendlink_submit" value="编辑" class="button"
            onclick="xajax.$('friendlink_submit').disabled=true;
                     xajax.$('friendlink_submit').value='请等待...';
                     xajax.$('detail').value = CKEDITOR.instances.detail.getData();
                     xajax_submit_form('amend',xajax.getFormValues('friendlink_amend'),'friendlink_submit');">
          </td>
        </tr>
      </table>
      </form>
      </div>
      {else}
      <div class="right_table">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="current_place">
        <tr>
          <td align="left" nowrap>&nbsp;
            <a href="{$control_admin}" target="_self" class="current_place">管理首页</a>
            &raquo; <a href="{$control_admin}?act=friendlink" target="_self" class="current_place">友情链接管理</a>
          </td>
          <td align="right" nowrap>
            {if $get.channel_id != "0"}
            [
            <a href="{$control_admin}?act=friendlink&ope=add&pag={$get.pag}" target="_self" class="current_place">添加友情链接</a>
            <a href="{$control_admin}?act=friendlink&pag={$get.pag}" target="_self" class="current_place">返回列表</a>
            ]
            {else}
            &nbsp;
            {/if}
          </td>
        </tr>
      </table>
      </div>

      {if $admin.ag_privilege.friendlink == "1"}
      <div class="space"></div>
      <div class="right_table">
      <form action="{$control_admin}?act=friendlink&ope=del&pag={$get.pag}" method="post" id="friendlink_list" name="friendlink_list">
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center" class="block_group">
        <tr align="left" class="block_header">
          <td colspan="11">友情链接列表</td>
        </tr>
        <tr class="block_title">
          <td width="5%">选择</td>
          <td width="5%">ID</td>
          <td width="35%" align="left">标题</td>
          <td width="10%">作者</td>
          <td width="10%">时间</td>
          <td width="5%">排序</td>
          <td width="5%">浏览</td>
          <td width="5%">转向</td>
          <td width="5%">状态</td>
          <td width="5%">置顶</td>
          <td width="10%">操作</td>
        </tr>
        {foreach name=friendlink_list from=$friendlink_list item=item}
        <tr align="center" class="block_list" onmouseover="this.className='block_list_over'" onmouseout="this.className='block_list'">
          <td nowrap><input type="checkbox" id="choice[{$item.id}]" name="choice[{$item.id}]" handle="topic" value="{$item.id}"></td>
          <td nowrap>{$item.id}</td>
          <td align="left">
            <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self" title="{$item.subject|str_entag:'space,br'}">{$item.subject|str_entag:'space,br'}</a>
          </td>
          <td nowrap><a href="{$control_admin}?act=member&ope=amend&mid={$item.post_id}" target="_self" title="{$item.subject|str_entag:'space,br'}">{$item.post_username}</a></td>
          <td nowrap><span title="{$item.post_time|date_format:"%Y-%m-%d %H:%M:%S"}">{$item.post_time|date_format:"%Y-%m-%d"}</span></td>
          <td nowrap>{$item.rank}</td>
          <td nowrap>{$item.click}</td>
          <td nowrap>
            <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self">
            {if $item.if_turn == "1"}<span class="state_yes">是</span>{else}<span class="state_cancel">否</span>{/if}
            </a>
          </td>
          <td nowrap>
            {if $item.if_enable == "1"}
              <span style="color:#00AA00;" title="当前状态为开启!">开</span>
              <a href="{$control_admin}?act=friendlink&ope=if_enable&friendlink_id={$item.id}&if_enable=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为关闭!">关</span></a>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#898989;" title="进入将状态更改为定时!">时</span></a>
            {elseif $item.if_enable == "2"}
              <a href="{$control_admin}?act=friendlink&ope=if_enable&friendlink_id={$item.id}&if_enable=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为开启!">开</span></a>
              <span style="color:#EA7408;" title="当前状态为关闭!">关</span>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#898989;" title="进入将状态更改为定时!">时</span></a>
            {else}
              <a href="{$control_admin}?act=friendlink&ope=if_enable&friendlink_id={$item.id}&if_enable=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为开启!">开</span></a>
              <a href="{$control_admin}?act=friendlink&ope=if_enable&friendlink_id={$item.id}&if_enable=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为关闭!">关</span></a>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#FFBC2D;" title="进入将状态更改为定时!">时</span></a>
            {/if}
          </td>
          <td nowrap>
            {if $item.if_top == "1"}
              <span style="color:#00AA00;" title="当前置顶为开启!">开</span>
              <a href="{$control_admin}?act=friendlink&ope=if_top&friendlink_id={$item.id}&if_top=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将置顶更改为关闭!">关</span></a>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#898989;" title="进入将置顶更改为定时!">时</span></a>
            {elseif $item.if_top == "2"}
              <a href="{$control_admin}?act=friendlink&ope=if_top&friendlink_id={$item.id}&if_top=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将置顶更改为开启!">开</span></a>
              <span style="color:#EA7408;" title="当前置顶为关闭!">关</span>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#898989;" title="进入将置顶更改为定时!">时</span></a>
            {else}
              <a href="{$control_admin}?act=friendlink&ope=if_top&friendlink_id={$item.id}&if_top=1&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为开启!">开</span></a>
              <a href="{$control_admin}?act=friendlink&ope=if_top&friendlink_id={$item.id}&if_top=2&pag={$get.pag}" target="_self"><span style="color:#898989;" title="将状态更改为关闭!">关</span></a>
              <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><span style="color:#FFBC2D;" title="进入将状态更改为定时!">时</span></a>
            {/if}
          </td>
          <td nowrap>
            <a href="{$control_admin}?act=friendlink&ope=amend&friendlink_id={$item.id}&pag={$get.pag}" target="_self"><img src="{$dir_images_admin}/icon_edit.gif" border="0" alt="改" title="修改" /></a>
            <a href="{$control_admin}?act=friendlink&ope=del&friendlink_id={$item.id}&pag={$get.pag}" target="_self" onClick="return confirm('真的要删除记录?')"><img src="{$dir_images_admin}/icon_delete.gif" border="0" alt="删" title="删除记录"></a>
          </td>
        </tr>
        {/foreach}
        <tr class="block_footer">
          <td colspan="11">
          <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table_clean">
            <tr>
              <td align="left">
              <input type="button" id="check_on" name="check_on" value="全选" class="button">
              <input type="button" id="check_off" name="check_off" value="不选" class="button">
              <input type="button" id="check_toggle" name="check_toggle" value="反选" class="button">
              </td>
              <td align="right">
              <input type="submit" value="删除" class="button" onClick="return confirm('真的要删除记录?')">
              </td>
            </tr>
          </table>
          </td>
        </tr>
      </table>
      </form>
      <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
        <tr>
          <td align="left">&nbsp;</td>
          <td align="right">
            <span class="pagination_post_list">
              <span class="pagelink_side" title="Total record{$pagination.record_total}">{$pagination.record_total}</span>
              <span class="pagelink_side" title="Current page{$pagination.page_current}/Page{$pagination.page_total}"><font color="#EA7408">{$pagination.page_current}</font>/{$pagination.page_total}</span>
              {if $pagination.page_listbegin != ""}<span class="pagelink_side" title="Go to first page"><a href="{$pagination.url|print_format:$pagination.page_listbegin}" target="_self" class="pagehref">&laquo;</a></span>{/if}
              {if $pagination.page_listbegin_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listbegin_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_previous != ""}<span class="pagelink_side" title="Previous page"><a href="{$pagination.url|print_format:$pagination.page_previous}" target="_self" class="pagehref">&#8249;</a></span>{/if}
              {foreach name=page_list from=$pagination.page_list item=page_list}
                {if $page_list.if_current == "1"}
                  <span class="pagelink_current" title="Current page{$page_list.page}"><font color="#EA7408">{$page_list.page}</font></span>
                {else}
                  <span class="pagelink" title="{$page_list.page}"><a href="{$pagination.url|print_format:$page_list.page}" target="_self" class="pagehref">{$page_list.page}</a></span>
                {/if}
              {/foreach}
              {if $pagination.page_next != ""}<span class="pagelink_side" title="Next page"><a href="{$pagination.url|print_format:$pagination.page_next}" target="_self" class="pagehref">&#8250;</a></span>{/if}
              {if $pagination.page_listend_more != ""}<span class="pagelink_side" title="Jump {$pagination.page_listnum/2|@floor} page"><a href="{$pagination.url|print_format:$pagination.page_listend_more}" target="_self" class="pagehref">...</a></span>{/if}
              {if $pagination.page_listend != ""}<span class="pagelink_side" title="Go to last page"><a href="{$pagination.url|print_format:$pagination.page_listend}" target="_self" class="pagehref">&raquo;</a></span>{/if}
              <select onchange="self.location.href=this.options[this.selectedIndex].value" class="select">
              {if $pagination.page_selectbegin != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin}">{$pagination.page_selectbegin}</option>{/if}
              {if $pagination.page_selectbegin_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectbegin_more}">...</option>{/if}
              {foreach name=page_select from=$pagination.page_select item=page_select}
                {if $page_select.if_current == "1"}
                  <option value="{$pagination.url|print_format:$page_select.page}" selected="selected">{$page_select.page}</option>
                {else}
                  <option value="{$pagination.url|print_format:$page_select.page}">{$page_select.page}</option>
                {/if}
              {/foreach}
              {if $pagination.page_selectend_more != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend_more}">...</option>{/if}
              {if $pagination.page_selectend != ""}<option value="{$pagination.url|print_format:$pagination.page_selectend}">{$pagination.page_selectend}</option>{/if}
              </select>
            </span>
          </td>
        </tr>
      </table>
      </div>
      {/if}
      {/if}

    </td>
  </tr>
</table>
{include file="pub_footer.htm"}